package com.aaa.ssm.result;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class AjaxResult implements Serializable {
    private int code;
    private String msg;
    private Object data;



    public static AjaxResult success(){
        return new AjaxResult(200,"成功",null);
    }
    public static AjaxResult success(Object data){
        return new AjaxResult(200,"成功",data);
    }
    public static AjaxResult error(){
        return new AjaxResult(400,"失败",null);
    }
    public static AjaxResult error(String msg){
        return new AjaxResult(400,msg,null);
    }


}
